<div class="subnav">

<?php echo $this->Html->link('Unanswered topics', array('controller' => 'forums', 'action' => 'unanswered'),array('style'=>"
    color: #999;
")); ?>
 <div class="forum-path"> 
<?php echo $this->Html->link('Project', array('controller' => 'projects', 'action' => 'view',$projectId)); ?> » 
</div>
    
</div>
<div class="forum-index">
    
  <table class="table table-bordered">
    <thead>
    <tr style="
        background-color: rgba(44, 43, 43, 0.79);
        color: whitesmoke;
    ">
        <th colspan="2" style="text-align:center">Forum</th>
        <th style="text-align:center">Topics</th>
        <th style="text-align:center">Posts</th>
        <th style="text-align:center">Last topic</th>
    </tr>
    </thead>
  
    
<!--  <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">-->
<!--    <tr>
      <th width="259">Forum</th>
      <th width="112">Topics</th>
      <th width="129">Posts</th>
      <th width="259">Last topic</th>
    </tr>-->
    <tbody>
    <?php 
		$i = 0;
		foreach($categories as $cat): 
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
		?>
    <tr<?php echo $class; ?>>
      <td colspan="2" >
          <strong>
              <?php echo $this->Html->link($cat['ForumCategory']['name'],  
					array('controller' => 'forums', 'action' => 'view', 
					$cat['ForumCategory']['id'])); ?>
           </strong>
              
              	
              <small><?php echo $cat['ForumCategory']['description']; ?></small>
          
      
      	
      </td>
      <td  style="text-align:center"><?php echo $cat['ForumCategory']['topics']; ?></td>
      <td  style="text-align:center"><?php echo $cat['ForumCategory']['posts']; ?></td>
      <td  style="text-align:center">
      	<?php echo $this->Html->link($cat['ForumCategory']['last_topic_subject'],  
					array('controller' => 'forums', 'action' => 'topic', $cat['ForumCategory']['last_topic_id'], $cat['ForumCategory']['id'])); ?>
                    <br />
	  	<?php echo $this->Time->format('d.m.Y H:i', $cat['ForumCategory']['last_topic_created']); ?> | 
        <?php echo $this->Html->link($cat['ForumCategory']['last_topic_username'], 
					array('controller' => 'users', 'action' => 'profile', $cat['ForumCategory']['last_topic_username'])); ?>
      </td>
    </tr>
    <?php endforeach; ?>
    </tbody>
    </table>
  </div>
<p align="right">
      
    <?php if($permiso)
        echo $this->Html->link('New Category', array('controller' => 'forums', 'action' => 'newcategory', $this->params['pass'][0]),array('class'=>'btn btn-inverse')); 
    ?>
</p>